<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="ko">
<head> 
<title>My ALIMI</title>
<meta charset=utf-8> 
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" type="text/css" href="${contextPath}/css/w.css" />
<link rel="stylesheet" type="text/css" href="${contextPath}/css/alimi.css" /> 
<script type="text/javascript" src="${contextPath}/js/libs/jindo.mobile.all.ns.js"></script>
<script type="text/javascript">
if (typeof keyword == 'undefined') { keyword = {}; }
keyword.list = {
	_aKeyword : null,
	
	init : function () {
		this._aKeyword =  jindo.$A(jindo.$$("a.keyword"));
		
		jindo.$Fn(function(e) {
			jindo.$Form("keywordList").value("keyword", jindo.$Event(e).currentElement.id);
			jindo.$Form("keywordList").$value().action = "/alimi/contents/getNew.alm";
			jindo.$Form("keywordList").submit();
		}).attach(this._aKeyword, "click");
	},
	
	
}

 function deleteKeyword( userKeywordKey, keyword) {
	if (confirm("삭제하시겠습니까?")) {
		location.href = "/alimi/keyword/delete.alm?keyword=" + keyword +"&userKeywordKey=" + userKeywordKey;	
	}
	
}

window.onload = function() {
	keyword.list.init();
}
</script>
</head> 
<body class="">
<form id="keywordList" name="keywordList" action="/alimi/keyword/add.alm" method="get">
<div class="headerTitle">
	<div class="nv1">
		<span>MY ALIMI - 키워드  </span>
	</div>
</div> 
<div class="sign-in">
	<input type="text" name="keyword" id="keyword">
	<input type="submit" class="g-button g-button-red" name="addKeyword" id="addKeyword" value="키워드 등록">
</div>

<div id="ct">
	<ul class="li1">
	<c:forEach var="userKeyword" items="${userKeywords}">
		<li>
		<span class="ctinline">
		<a href="#" id="${userKeyword.keyword}" class="keyword elip_title"><span><B>${userKeyword.keyword}</B></span></a>
		</span>
		<span class="ctinlineright">
		<span STYLE="color:red;">${userKeyword.newContentCount}</span> / ${userKeyword.userContentCount} 
		<input type="button" value="삭제" onclick="javascript:deleteKeyword('${userKeyword.userKeywordKey}', '${userKeyword.keyword}')">
		</span>
		</li>
	</c:forEach>
	</ul>
</div>

</form>

</body>
</html>
